<template>
  <div>
    <helper-home page="sort" :sortInfo="sortSurplusInfo"></helper-home>
    <set-order></set-order>
  </div>
</template>
<script>
import HelperHome from '../../components/helperHome'
import { getSurplusSortApi } from '@/api/marketShop'
import setOrder from './setOrder'
import {mapGetters} from 'vuex'
export default {
  components:{
    HelperHome,
    setOrder
  },
  data(){
    return {
      sortSurplusInfo:[]
    }
  },
  computed:{
    ...mapGetters(['gasInfo'])
  },
  created(){
    this.getSurplus()
  },
  methods:{
    async getSurplus(){
      try{
        const { code, result } = await getSurplusSortApi({gasId: this.gasInfo.gasId})
        if( code !== 200 ) return
        this.sortSurplusInfo = result
      }catch(e){
        console.log(e)
      }
    }
  }
}
</script>
